package com.xu.sso.server.service;

import com.xu.sso.core.exception.SSOException;
import com.xu.sso.core.model.BaseResponse;
import com.xu.sso.db.model.base.Department;
import com.xu.sso.db.model.base.User;
import com.xu.sso.server.model.request.ApiLogoutRequest;
import com.xu.sso.server.model.request.LoginRequest;
import com.xu.sso.server.model.response.LoginResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface LoginService {

    LoginResponse checkLogin(HttpServletRequest request) throws SSOException;

    LoginResponse login(LoginRequest request) throws SSOException;

    void logout(HttpServletRequest request, HttpServletResponse response);

    BaseResponse register(User user) throws SSOException;

    BaseResponse reset(String username, String mail) throws SSOException;

    List<Department> findAllDepartments();

    BaseResponse logout(ApiLogoutRequest request) throws SSOException;

}
